#ifndef __SSHQLOG_H__
#define __SSHQLOG_H__
#pragma once
#include "common.h"
#include <map>
#include <mutex>
#include <fstream>

class CSSHQLog
	:public SingletonInstance<CSSHQLog>
{
	CSSHQLog();
	friend class SingletonInstance<CSSHQLog>;
public:

	bool InitLogEnv(const char *filename, unsigned int nLogLvl, unsigned int maxSizeMB = 10);
	void WriteLog(int loglvl, const char * format, ...);
	~CSSHQLog();

public:
	std::ofstream file;
	bool bInit;
	unsigned int m_nMaxSize;
	unsigned int m_nLogLvl;
	std::string  m_strFile;
	std::mutex   m_mutex;
};

#endif
